package com.xn.controller;

import com.xn.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @GetMapping("create/{flag}")
    public String createOrder(@PathVariable String flag){
        String out = "success!";
        try {
            orderService.createOrder(flag);
        }catch (Exception e){
            out = "false";
        }
        return out;
    }
}
